//
//  GoodDetailModel.m
//  B2C
//
//  Created by xiaowu on 2017/8/4.
//  Copyright © 2017年 lixiaolong. All rights reserved.
//

#import "GoodDetailModel.h"
#import "GoodAttributeModel.h"

@implementation GoodsFullCut

MJCodingImplementation
@end

@implementation GoodDetailGtotsModel

MJCodingImplementation
@end

@implementation GoodDetailModel

MJCodingImplementation
+ (NSDictionary *)mj_objectClassInArray {
    return @{@"imgs":[ImageUrlModel class],
             @"goodsimg":[ImageUrlModel class],
             @"attribute":[GoodAttributeModel class],
             @"goodspricetaid":[GoodsPriceTaidModel class],
             @"goodsattribute":[GoodsAttributePriceModel class],
             @"gtots":[GoodDetailGtotsModel class],
             @"fullcut":[GoodsFullCut class],
             @"coupon":[CouponModel class]
             };
}
- (NSArray *)getImgsUrl {
    
    NSMutableArray *urlArrs = [NSMutableArray array];
    for (ImageUrlModel *model in self.goodsimg) {
        if (model.giimg.length > 0) {
            [urlArrs addObject:model.giimg];
        }
    }
    return urlArrs;
}
- (NSArray *)getGtotsStr {
    NSMutableArray *strArr = [NSMutableArray array];
    for (GoodDetailGtotsModel *gtots in self.gtots) {
        [strArr addObject:gtots.gtname];
    }
    return strArr;
}
- (BOOL)isgroupbuy {
    if (TextIsNotNil(self.pgprice)) {
        return YES;
    }
    return NO;
}
- (NSString *)goldprice {
    return [_goldprice replacePriceSuffix];
}
- (NSString *)gprice {
    return [_gprice replacePriceSuffix];
}
- (NSString *)pgprice {
    return [_pgprice replacePriceSuffix];
}
- (NSString *)gseckillprice {
    return [_gseckillprice replacePriceSuffix];
}

@end
